package com.itheima.service.impl;

import com.itheima.domain.Patient;
import com.itheima.mapper.PatientMapper;
import com.itheima.service.PatientService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/*
 *Author:TH
 *Dete:2019/10/1419:55
 */
@Service
public class PatientServiceImpl implements PatientService{
    @Autowired
    private PatientMapper patientMapper;

    @Override
    public List<Patient> findAll() {
        return patientMapper.findAll();
    }

    @Override
    public void save(Patient patient) {
        patientMapper.save(patient);
    }

    @Override
    public Patient findById(String id) {
        int pid = Integer.parseInt(id);
        return patientMapper.findById(pid);
    }

    @Override
    public void change(Patient patient) {
        patientMapper.change(patient);
    }
}
